import {ipcMain} from 'electron';

let music = require("@/nodeID3/music");

// 根据路径获取音乐信息
ipcMain.on("getMusicInfoElectron", (event, url) => {
    // 同步步消息
    let musicInfoID3 = music.getMusicInfoID3(url);
    console.log("url", url)
    console.log("musicInfoID3", musicInfoID3)
    event.returnValue = musicInfoID3;
    // 异步消息
    // event.sender.send("musicInfoElectron", music.getMusicInfoID3(args));
});

// 获取本地音乐
ipcMain.on("getMusicListLocalElectron", (event, url) => {
    // 同步步消息
    let getMusicListLocalID3 = music.getMusicListLocalID3(url);
    console.log("getMusicListLocalID3", getMusicListLocalID3)
    event.returnValue = getMusicListLocalID3;
    // 异步消息
    // event.sender.send("musicInfoElectron", music.getMusicInfoID3(args));
});
